package com.hbpu.maven.spring.ioc.config;

import com.hbpu.maven.spring.ioc.bean.Dog;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.context.annotation.*;
import org.springframework.core.annotation.Order;

//@Import(Dog.class)
@Configuration
public class DogConfig {
//    @Primary
    @Profile("p")
    @Bean()
    public Dog dog() {
        Dog dog = new Dog();
        dog.setText("dog bean");
        return dog;
    }

    @Profile("default")
    @Bean()
    public Dog dog01() {
        Dog dog = new Dog();
        dog.setText("dog01 bean");
        return dog;
    }

    @Bean
    public String getUUID() {
        return dog().getName();
    }
}
